---
title: 0.31.1
description: Anchor - Release Notes 0.31.1
---

This patch release aims to fix `proc-macro2` related IDL build errors (see
[`proc-macro2` build fix](#proc-macro2-build-fix)).

New Releases for Anchor will be published under the `solanafoundation` GitHub
organization from now on.

---

## How to upgrade

1. Update `anchor-cli`:

   ```sh
   avm install 0.31.1
   ```

2. Update Anchor crate(s) to `0.31.1`.

3. Update TS package(s) to `0.31.1`.

## Recommended Solana Version

The recommended Solana version is `2.1.0`, the same as
[v0.31.0's Recommended Solana Version](./0-31-0#recommended-solana-version).

## Docker

This release uses a new docker image found at
[solanafoundation/anchor](https://hub.docker.com/r/solanafoundation/anchor). New
images will be pushed to this organization in the future.

## IDL

### `proc-macro2` build fix

`proc-macro2 1.0.95` removed the `source_file` method of `Span` due to an
underlying `nightly` compiler change
[rust-lang/rust#139671](https://github.com/rust-lang/rust/pull/139671), which
resulted in the following error for Anchor users:

```
error[E0599]: no method named `source_file` found for struct `proc_macro2::Span` in the current scope
```

This should now be fixed in this release.

## TypeScript

### Account resolver no longer requires wallet

Resolving signers had a wallet requirement, and failing to meet this requirement
resulted in the following error:

```
This function requires the `Provider` interface implementor to have a `wallet` field.
```

Now, it's only required for the `publicKey` field of `Provider` to be set.

### Multiple constant generics

An issue where having multiple constant generics would result in parsing errors
has been fixed.

---

See the full list of notable changes in the
[CHANGELOG](https://github.com/solana-foundation/anchor/blob/v0.31.1/CHANGELOG.md#0311---2025-04-19).
